using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(menuName = "Custom/Mob Pool Data")]
public class MobPoolData:ScriptableObject {

	[SerializeField] GameObject[] small;
	[SerializeField] GameObject[] special;
	[SerializeField] GameObject[] big;

	public virtual void GenerateOn(Vector2 position,int rank) {
		GameObject[] targetArray = big;
		if(rank==1) targetArray=special;
		if(rank==2) targetArray=small;
		int index = Random.Range(0,targetArray.Length);
		GameObject newGo = Instantiate(targetArray[index],position,Quaternion.identity,Utility.dynamicParent.transform);
		if(newGo.GetComponent<IGenerationComponent>()!=null)
			newGo.GetComponent<IGenerationComponent>().OnGeneration();
	}


}